<?php
/**
 * Created by PhpStorm.
 * User: alice
 * Date: 2015/12/28
 * Time: 12:26
 */

/**
 * Class Involved_LogisticsLineModel
 */

class Involved_LogisticsLineModel extends BaseModel{

    protected $table = 'logistics_line';


    /**********************  APP接口   ***************************/

    /**
     * 物流线路列表
     * @param $departure
     * @param $destination
     * @param $spec_time
     * @author alice
     * @date 2016-1-23
     * @return mixed
     */
    public function LogisticsLine($departure,$destination,$spec_time)
    {
        return  DB::table($this->table)
                ->select('departure','destination','model_type','truck_length','truck_weight','take_time','spec_time')
                ->where(['departure'=>$departure,'destination'=>$destination,'spec_time'=>$spec_time])
                ->get();
    }



    /**********************  PC端   ***************************/


    /**
     * 物流线路列表
     * @author alice
     * @date 2016-1-19
     * @return mixed
     */
    public function ShowLogisticsList()
    {
        return  DB::table($this->table)->paginate(8);
    }

    /**
     * 物流线路详情
     * @return mixed
     */
    public function ShowLogisticsInfo($id)
    {
        return  DB::table($this->table)->where('wl_id',$id)->first();
    }


    /**
     * 获取物流列表
     * @author fyl
     * @date 2016-3-29
     */
    public function AdminTransportList()
    {
        return DB::table($this->table)->get();
    }

    /**
     * 根据ID获取物流线路详情
     * @param $wl_id
     * @return mixed
     */
    public function GetLogisticsLineById($wl_id)
    {
        return  DB::table($this->table)
            ->where('logistics_line.wl_id',$wl_id)
            ->first();
    }










}